Skip to content

Auto-surface the /issues ledger via a SessionStart hook#1052

Merged
BigSimmo merged 2 commits into
mainfrom
claude/task-tracking-issues-skill-82jxwr
Jul 22, 2026
Merged

Auto-surface the /issues ledger via a SessionStart hook#1052
BigSimmo merged 2 commits into
mainfrom
claude/task-tracking-issues-skill-82jxwr

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to the merged /issues tracker (Add /issues skill and outstanding-work memory ledger #1018): makes the outstanding-work memory push, not just pull.
  • Adds .claude/hooks/issues-surface.sh, wired into the existing SessionStart group in .claude/settings.json, so every session starts with the open items from docs/outstanding-issues.md already in context — P1/P2 listed, P3 collapsed to a count.
  • On a context reset (compact/resume/clear) it additionally nudges a /issues capture, which is the moment in-flight follow-ups are most likely to be lost. SessionStart is the only hook event whose stdout reaches the model and that fires on compaction, so it's the correct mechanism (verified against the current Claude Code hook contract; SessionEnd is cleanup-only, PreCompact isn't model-facing).
  • The hook is read-only: it never writes or commits the ledger and always exits 0, so it cannot break a session.
  • Documented in the AGENTS.md /issues section.

Verification

  • npm run verify:pr-local

Verification not run: change is a read-only bash SessionStart hook plus a .claude/settings.jsonwire-up and an AGENTS.md doc note — no application source, config, or test code is touched, so the app gates do not apply. Instead: (1) ran the hook against the real ledger forsource=startupandsource=compact— correct open-item summary, correct conditional reminder, exit 0 both times; (2) validated.claude/settings.jsonparses as JSON; (3)prettier --checkclean on.claude/settings.jsonandAGENTS.md.

Risk and rollout

  • Risk: Minimal and self-contained. The hook only reads a markdown file and prints a summary; a parse error or missing ledger degrades to less/no output (every step guarded, always exit 0). It runs alongside — not replacing — the existing Node-install and base-freshness SessionStart hooks.
  • Rollback: Remove the appended issues-surface.sh entry from .claude/settings.json and delete the script.
  • Provider or production effects: None. No runtime, retrieval, ranking, clinical, privacy, or deployment behavior changes.

Clinical Governance Preflight

Not applicable — no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output is touched.

Notes

  • Parsing is scoped to the ## Open items table only, so the Resolved / archive table is never counted.
  • docs/outstanding-issues.md itself is not modified by this PR; it is actively maintained by the /issues skill.

🤖 Generated with Claude Code

https://claude.ai/code/session_018v3T5ahDyiT8nHqdjCdfB8


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Sessions now automatically display outstanding issue summaries, including priority counts and selected high-priority items.
    • Context resets provide a reminder to capture newly discovered issues.
    • Session startup also checks whether the project base is up to date.
  • Documentation

    • Documented the session issue-summary behavior and confirmed it does not modify the issues ledger.

Add .claude/hooks/issues-surface.sh, wired into the existing SessionStart
group in .claude/settings.json, so every session starts with the open
outstanding-work items already in context (P1/P2 listed, P3 collapsed to a
count). On a context reset (compact/resume/clear) it also nudges a
/issues capture so in-flight follow-ups aren't lost.

The hook is read-only: it never writes or commits the ledger, and always
exits 0 so it can't break a session. Documented in the AGENTS.md /issues
section.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A new SessionStart hook reads and summarizes open issues, conditionally emits /issues capture reminders, and always exits successfully. SessionStart now runs base freshness checking before the hook, and AGENTS.md documents the integration.

Changes

Session-start issues surface

Layer / File(s) Summary
Parse and render open issues
.claude/hooks/issues-surface.sh
Reads the Open items table, groups output by priority with P2 truncation and P3 collapsing, and emits context-reset or wrap-up reminders.
SessionStart wiring and documentation
.claude/settings.json, AGENTS.md
Runs base freshness checking before the issues hook and documents the read-only integration and reminder behavior.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Suggested labels: codex

Sequence Diagram(s)

sequenceDiagram
  participant SessionStart
  participant IssuesSurface as issues-surface.sh
  participant IssuesLedger as outstanding-issues.md
  SessionStart->>IssuesSurface: invoke hook with session input
  IssuesSurface->>IssuesLedger: read Open items table
  IssuesLedger-->>IssuesSurface: open issue rows
  IssuesSurface-->>SessionStart: priority summary and reminder
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: a SessionStart hook that auto-surfaces the /issues ledger.
Description check ✅ Passed The description matches the template and includes Summary, Verification, Risk and rollout, Clinical Governance Preflight, and Notes with substantive details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/task-tracking-issues-skill-82jxwr

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jul 22, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 22, 2026 01:37
@BigSimmo
BigSimmo enabled auto-merge (squash) July 22, 2026 01:38
@BigSimmo
BigSimmo merged commit ca08128 into main Jul 22, 2026
18 checks passed
@BigSimmo
BigSimmo deleted the claude/task-tracking-issues-skill-82jxwr branch July 22, 2026 01:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/hooks/issues-surface.sh:
- Around line 59-80: Update print_group so each issue summary in sum is
normalized and truncated to a bounded length before rendering in the echo
output. Preserve the existing priority, ID, type, counting, and “more” behavior,
and append an ellipsis when the summary exceeds the cap.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 851fdc92-7925-4df3-b05d-64b52bba56c2

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb9bc7 and 59da955.

📒 Files selected for processing (3)
  • .claude/hooks/issues-surface.sh
  • .claude/settings.json
  • AGENTS.md

Comment on lines +59 to +80
print_group() { # $1=rows $2=max-to-list
local data="$1" limit="$2" shown=0 more=0 pri id typ sum
[ -z "$data" ] && return 0
while IFS=$'\t' read -r pri id typ sum; do
[ -z "$pri" ] && continue
if [ "$shown" -lt "$limit" ]; then
echo " ${pri} ${id} ${typ} — ${sum}"
shown=$((shown + 1))
else
more=$((more + 1))
fi
done <<EOF
$data
EOF
[ "$more" -gt 0 ] && echo " … +${more} more at this priority (see /issues)"
return 0
}

# P1 = do-next, list all. P2 = should-do, list up to 8. P3 = collapse to a count.
[ "$c1" -gt 0 ] && print_group "$p1" 999
[ "$c2" -gt 0 ] && print_group "$p2" 8
[ "$c3" -gt 0 ] && echo " ${c3} × P3 (nice-to-have / revisit-when) — see /issues"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Bound each rendered issue summary.

At Line 65, ${sum} is injected into SessionStart output without truncation. A long ledger summary can overwhelm the “compact” context surface; normalize and cap it with an ellipsis before echoing it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/hooks/issues-surface.sh around lines 59 - 80, Update print_group so
each issue summary in sum is normalized and truncated to a bounded length before
rendering in the echo output. Preserve the existing priority, ID, type,
counting, and “more” behavior, and append an ellipsis when the summary exceeds
the cap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants